package demo.kk;


import java.util.concurrent.CompletableFuture;

/**
* 
* @author : feixiang.li
* @since : 2025-09-16 18:10
*/
public class Test11 {
    public static void main(String[] args) {
        CompletableFuture<Integer> future = CompletableFuture.supplyAsync(() -> {
            try {
                Thread.sleep(2000);
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
            }
            return 42;
        });
        future.thenAccept(result -> System.out.println("计算结果: " + result));

    }
}
